<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.taobao</groupId>
        <artifactId>parent</artifactId>
        <version>2.0.0</version>
    </parent>

    <groupId>com.autonavi.abs</groupId>
    <artifactId>${appProperty.appName}</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>
    <name>${appProperty.appName}</name>

    <properties>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <mockito-all.version>1.10.19</mockito-all.version>
        <maven-antrun.version>1.8</maven-antrun.version>
        <mybatis-starter.version>2.1.0</mybatis-starter.version>
        <spring-boot.version>2.1.13.RELEASE</spring-boot.version>
        <spring-boot-maven.version>2.2.5.RELEASE</spring-boot-maven.version>
        <pandora-boot.version>2020-04-release</pandora-boot.version>
        <pandora-boot-maven-plugin.version>2.1.13.2</pandora-boot-maven-plugin.version>
        <mysql.version>5.1.40</mysql.version>
        <guava.version>18.0</guava.version>
        <lombok.version>1.18.8</lombok.version>
        <commons-io.version>2.5</commons-io.version>
        <commons-collections.version>4.1</commons-collections.version>
        <fastjson.version>1.2.68.noneautotype</fastjson.version>
        <javax-servlet.version>3.1.0</javax-servlet.version>
        <abs-common.version>1.0.1.5</abs-common.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${r'$'}{spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.taobao.pandora</groupId>
                <artifactId>pandora-boot-starter-bom</artifactId>
                <version>${r'$'}{pandora-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>${r'$'}{mockito-all.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <dependency>
            <groupId>com.autonavi.abs</groupId>
            <artifactId>amap-abs-common</artifactId>
            <version>${r'$'}{abs-common.version}</version>
        </dependency>

        <!-- spring boot -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator-autoconfigure</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.zaxxer</groupId>
                    <artifactId>HikariCP</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.taobao.pandora</groupId>
            <artifactId>taobao-hsf.sar</artifactId>
        </dependency>

        <!-- pandora boot-->
        <dependency>
            <groupId>com.taobao.pandora</groupId>
            <artifactId>pandora-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>com.taobao.pandora</groupId>
            <artifactId>pandora-boot-bootstrap</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba.boot</groupId>
            <artifactId>pandora-hsf-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba.boot</groupId>
            <artifactId>pandora-tddl-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>com.taobao.pandora</groupId>
            <artifactId>pandora-boot-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <!-- guava工具包，google提供 -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${r'$'}{guava.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>${r'$'}{mybatis-starter.version}</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${r'$'}{mysql.version}</version>
        </dependency>

        <!-- apache utils -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${r'$'}{commons-io.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${r'$'}{commons-collections.version}</version>
        </dependency>

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>${r'$'}{fastjson.version}</version>
        </dependency>

        <!-- lombok -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${r'$'}{lombok.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${r'$'}{javax-servlet.version}</version>
        </dependency>

    </dependencies>

    <build>
        <finalName>${appProperty.appName}</finalName>
        <filters>
            <filter>src/main/profiles/${r'$'}{env}/env.properties</filter>
        </filters>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>*.properties</include>
                    <include>*.yml</include>
                    <include>*.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>*.properties</exclude>
                    <exclude>*.yml</exclude>
                    <exclude>*.xml</exclude>
                </excludes>
                <filtering>false</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${r'$'}{maven.compiler.source}</source>
                    <target>${r'$'}{maven.compiler.target}</target>
                    <encoding>${r'$'}{project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${r'$'}{spring-boot-maven.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <!-- 应用名（最后压缩包的名字） -->
                    <finalName>${appProperty.appName}</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>assembly.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <delimiters>
                        <delimiter>${r'${*}'}</delimiter>
                        <delimiter>@</delimiter>
                    </delimiters>
                    <useDefaultDelimiters>false</useDefaultDelimiters>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.taobao.pandora</groupId>
                <artifactId>pandora-boot-maven-plugin</artifactId>
                <version>${r'$'}{pandora-boot-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>${r'$'}{maven-antrun.version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <tasks>
                                <unzip
                                        src="${r'${project.build.directory}'}/${r'${project.build.finalName}'}.${r'${project.packaging}'}"
                                        dest="${r'${project.build.directory}'}/${appProperty.appName}"/>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <!-- 指定使用filter -->
    </build>

    <profiles>
        <!-- 开发环境，默认激活 -->
        <profile>
            <id>local</id>
            <properties>
                <env>local</env>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <!-- 日常环境 -->
        <profile>
            <id>daily</id>
            <properties>
                <env>daily</env>
            </properties>
        </profile>
        <!-- 预发环境 -->
        <profile>
            <id>prepub</id>
            <properties>
                <env>prepub</env>
            </properties>
        </profile>
        <profile>
            <id>prepub--ea119</id>
            <properties>
                <env>prepub--ea119</env>
            </properties>
        </profile>
        <profile>
            <id>prepub--na610</id>
            <properties>
                <env>prepub--na610</env>
            </properties>
        </profile>
        <profile>
            <id>prepub--na620</id>
            <properties>
                <env>prepub--na620</env>
            </properties>
        </profile>
        <profile>
            <id>prepub--su121</id>
            <properties>
                <env>prepub--su121</env>
            </properties>
        </profile>

        <!-- 生产环境 -->
        <profile>
            <id>publish</id>
            <properties>
                <env>publish</env>
            </properties>
        </profile>
        <profile>
            <id>publish--ea119</id>
            <properties>
                <env>publish--ea119</env>
            </properties>
        </profile>
        <profile>
            <id>publish--na610</id>
            <properties>
                <env>publish--na610</env>
            </properties>
        </profile>
        <profile>
            <id>publish--na620</id>
            <properties>
                <env>publish--na620</env>
            </properties>
        </profile>
        <profile>
            <id>publish--su121</id>
            <properties>
                <env>publish--su121</env>
            </properties>
        </profile>

    </profiles>
</project>
